import request from '@/utils/request'

export function getRoutesByRoles(query) {
  return request({
    url: '/admin-menus/getByRoles',
    method: 'get',
    params: query
  })
}

export function fetchList(query) {
  return request({
    url: '/admin-menus/list',
    method: 'get',
    params: query
  })
}

export function createModel(data) {
  return request({
    url: '/admin-menus/create',
    method: 'post',
    data
  })
}

export function updateModel(data) {
  return request({
    url: '/admin-menus/update',
    method: 'post',
    data
  })
}

export function deleteModel(data) {
  return request({
    url: '/admin-menus/delete',
    method: 'post',
    data
  })
}